<template>
  <el-dropdown trigger="click">
    <el-badge dot>
      <div class="contact-icon">
        <i class="i-svg:telephone" />
      </div>
    </el-badge>

    <template #dropdown>
      <div class="contact-card">
        <!-- 电话 -->
        <el-row class="contact-item">
          <el-col :span="4" class="icon-col">
            <i class="i-svg:telephone contact-type-icon" />
          </el-col>
          <el-col :span="20" class="content-col">
            <div class="contact-info">123-4567-7890</div>
          </el-col>
        </el-row>

        <!-- QQ -->
        <el-row class="contact-item">
          <el-col :span="4" class="icon-col">
            <i class="i-svg:qq contact-type-icon" />
          </el-col>
          <el-col :span="20" class="content-col">
            <div class="contact-info">123456789</div>
          </el-col>
        </el-row>

        <!-- 微信 -->
        <el-row class="contact-item">
          <el-col :span="4" class="icon-col">
            <i class="i-svg:wechat contact-type-icon" />
          </el-col>
          <el-col :span="20" class="content-col">
            <el-image
              :src="src"
              class="qr-code"
              fit="contain"
            />
          </el-col>
        </el-row>
      </div>
    </template>
  </el-dropdown>
</template>

<script setup lang="ts">
const src = "https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg";
</script>

<style lang="scss" scoped>
.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  cursor: pointer;

  i {
    font-size: 18px;
    color: #606266;
  }
}

.contact-card {
  padding: 12px 16px;
  width: 240px;
  box-sizing: border-box;
}

.contact-item {
  margin-bottom: 12px;
  align-items: center;

  &:last-child {
    margin-bottom: 0;
  }
}

.icon-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-type-icon {
  font-size: 20px;
  color: var(--el-color-primary);
}

.content-col {
  display: flex;
  align-items: center;
  padding-left: 8px;
}

.contact-info {
  font-size: 14px;
  color: #606266;
}

.qr-code {
  width: 100px;
  height: 100px;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
</style>
